package com.airbat.prize.common.enums;

import com.airbat.prize.common.core.LongArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 线索状态
 */
@Getter
@AllArgsConstructor
public enum ClueStateEnum implements LongArrayValuable {

    //状态 0待发布 1已发布 2待签收 21异议 22异议通过 23异议驳回 3初步分析 4一见面 5核查提纲 6核查提纲审批 7核查处置 8二见面 9核查反馈 10反馈审批 11已办结

    BXS(-1, "不显示"),
    DFB(0, "待发布"),
    YFB(1, "已发布"),
    YY(2, "申请异议"),
    YYTG(21, "异议通过"),
    YYBH(22, "异议驳回"),
    YQS(3, "已签收"),
    CBFX(4, "初步分析"),
    YJM(5, "一见面"),
    HCTG(6, "核查提纲"),
    HCTGSH(7, "核查提纲审批"),
    HCTGSH_TY(71, "核查提纲审批同意"),
    HCTGSH_BH(72, "核查提纲审批驳回"),
    HCCZ(8, "核查处置"),
    EJM(9, "二见面"),
    HCFK(10, "核查反馈"),
    FKSH(11, "反馈审批"),
    YBJ(12, "已办结");

    /**
     * 值
     */
    private final long value;
    /**
     * 名称
     */
    private final String name;

    public static final long[] ARRAYS = Arrays.stream(values()).mapToLong(ClueStateEnum::getValue).toArray();

    @Override
    public long[] array() {
        return ARRAYS;
    }

    public static ClueStateEnum getEnum(long value) {
        return Arrays.stream(values()).filter(tr -> tr.getValue() == value).findFirst().get();
    }

}
